<?php

namespace App\Kuafu\WaiMai\Enum;

use App\Kuafu\Mybank\Model\MybankBillRecordModel;

class WaiMaiDBEnum
{
    const ORDER_STATUS_TOTAL = -1; // 查全部
    const ORDER_STATUS_0     = 0; // 未生效
    const ORDER_STATUS_1     = 1; // 已支付，待接单
    const ORDER_STATUS_2     = 2; // 已接单
    const ORDER_STATUS_3     = 3; // 待配送
    const ORDER_STATUS_4     = 4; // 配送中
    const ORDER_STATUS_5     = 5; // 已完成
    const ORDER_STATUS_6     = 6; // 退单中
    const ORDER_STATUS_7     = 7; // 已取消
    const ORDER_STATUS_8     = 8; // 已拒单

    // 订单完结状态
    const ORDER_STATUS_OVER = [
        self::ORDER_STATUS_5,
        self::ORDER_STATUS_7,
    ];

    const ORDER_STATUS_TEXT = [
        self::ORDER_STATUS_0 => '未生效',
        self::ORDER_STATUS_1 => '待接单',
        self::ORDER_STATUS_2 => '待制作',
        self::ORDER_STATUS_3 => '待配送',
        self::ORDER_STATUS_4 => '配送中',
        self::ORDER_STATUS_5 => '已完成',
        self::ORDER_STATUS_6 => '退单中',
        self::ORDER_STATUS_7 => '已取消',
        self::ORDER_STATUS_8 => '已拒单',
    ];

    public const SOURCE_TYPE_MT_WM  = 3; // 美团外卖
    public const SOURCE_TYPE_ELM    = 4; // 饿了么外卖
    public const SOURCE_TYPE_MT_TG  = 5; // 美团团购
    public const SOURCE_TYPE_OWNER  = 6; // 自营外卖
    public const SOURCE_TYPE_DOUYIN = 7; // 抖音团购

    public const SOURCE_TYPE_FUYOU   = 8; // 富友支付
    public const SOURCE_TYPE_INVOICE = 9; // 开票信息
    public const SOURCE_TYPE_DOUYIN_WM = 10; // 抖音外卖
    public const SOURCE_TYPE_XHS     = 11; // 小红书

    const SOURCE_TYPE_TEXT = [
        self::SOURCE_TYPE_MT_WM     => '美团外卖',
        self::SOURCE_TYPE_ELM       => '饿了么外卖',
        self::SOURCE_TYPE_MT_TG     => '美团团购',
        self::SOURCE_TYPE_DOUYIN    => '抖音团购',
        self::SOURCE_TYPE_DOUYIN_WM => '抖音外卖',
    ];

    // 退款状态 - 返回给api
    const REFUND_STATUS_0 = 0;
    const REFUND_STATUS_1 = 1;
    const REFUND_STATUS_2 = 2;
    const REFUND_STATUS_3 = 3;

    const REFUND_STATUS_TEXT = [
        self::REFUND_STATUS_0 => '未发起退款',
        self::REFUND_STATUS_1 => '退款中',
        self::REFUND_STATUS_2 => '退款成功',
        self::REFUND_STATUS_3 => '部分退款',
    ];

    // 退款类型
    const REFUND_TYPE_TOTAL = 1;
    const REFUND_TYPE_PART  = 2;

    // 查菜品列表的单页最大值
    const PRODUCT_MAX_PAGE_NUM = 200;

    // 出餐状态
    const FINISH_OK   = 1;
    const FINISH_NO   = 0;

    // 开关
    const SWITCH_ON  = 1; // 开
    const SWITCH_OFF = 0; // 关

    // 夸父承诺出餐时间 - 默认值
    const KF_PROMISE_DEFAULT_TIME = 600;

    // 饿了么承诺出餐开关 - 默认值
    const ELM_PROMISE_DEFAULT_SWITCH = self::SWITCH_OFF;

    // 静默自动出餐开关 - 默认值
    const SILENT_DEFAULT_SWITCH = self::SWITCH_OFF;

    // 是否部分退款
    const IS_PART_REFUND_0 = 0; // 否
    const IS_PART_REFUND_1 = 1; // 是

    // 发票key
    const TAX_CODE  = 'code';
    const TAX_TITLE = 'title';
    const TAX_EMAIL = 'email';
    const TAX_TYPE  = 'type';

    const TAX_TEXT = [
        self::TAX_CODE => '税号',
        self::TAX_TITLE => '抬头',
        self::TAX_EMAIL => '邮箱',
        self::TAX_TYPE => '类型',
    ];

    //订单来源和账单来源
    const SOURCE_TYPE_BILL_TO_TYPE = [
        MybankBillRecordModel::SOURCE_MEITUAN => self::SOURCE_TYPE_MT_WM,//美团外卖
        MybankBillRecordModel::SOURCE_ELE     => self::SOURCE_TYPE_ELM,//饿了么外卖
        MybankBillRecordModel::SOURCE_DOUYIN  => self::SOURCE_TYPE_DOUYIN_WM,//抖音外卖
    ];
}
